{include file="layout/layout" /}
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>管理员 - 编辑管理员</h3>
                <h5>网站系统管理员资料</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="adminHandle" action="{:url('Agent/submint_admin')}" method="post">
        <input type="hidden" name="act" value="{$act}">
        <input type="hidden" name="age_id" value="{$info.age_id}">
        <input type="hidden" name="age_agent_manage" value="{$agent_manage}">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="user_name"><em>*</em>用户名</label>
                </dt>
                <dd class="opt">
                    <div><input type="text" {notempty name="info"}disabled {else/} name="age_username" ajaxurl="{:url('agent/ajaxUsername')}" datatype="*5-18" errormsg="用户名格式不正确，为5-18位字符串！" {/notempty}  value="{$info.age_username}" class="input-txt"></div>
                    <p class="notic" >用户名为5-18位字符串</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="nickname"><em>*</em>昵 称</label>
                </dt>
                <dd class="opt">
                    <div><input type="text" name="age_nickname" value="{$info.age_nickname}" datatype="*" errormsg="昵称不能为空" id="nickname" class="input-txt"></div>
                    <p class="notic">管理员昵称或真实姓名</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="email"><em>*</em>管理员手机号码</label>
                </dt>
                <dd class="opt">
                    <div><input type="text" name="age_phone" ignore="ignore" value="{$info.age_phone}" datatype="m" errormsg="手机号码格式不正确" id="m" class="input-txt"></div>
                    <p class="notic">管理人员手机号码</p>
                </dd>
            </dl>

            {if $info eq null}
            <dl class="row">
                <dt class="tit">
                    <label for="password"><em>*</em>登陆密码</label>
                </dt>
                <dd class="opt">
                    <div><input type="text" name="age_password" value="{$info.age_password}" datatype="s6-18" errormsg="密码格式错误！" id="password" class="input-txt"></div>
                    <p class="notic">登陆密码为6-18位字符串</p>
                </dd>
            </dl>
            {else/}
                <dl class="row">
                    <dt class="tit">
                        <label for="password"><em>*</em>最近登录时间</label>
                    </dt>
                    <dd class="opt">
                        <div><input type="text" disabled value="{$info.age_login_time}" class="input-txt"></div>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label for="password"><em>*</em>最近登录IP</label>
                    </dt>
                    <dd class="opt">
                        <div><input type="text" disabled value="{$info.age_login_ip}" class="input-txt"></div>
                    </dd>
                </dl>
            {/if}
            {if condition=" ($act eq 'add') OR ($info['age_level'] eq 1)"}
            <dl class="row">
                <dt class="tit">
                    <label><em></em>管理员状态</label>
                </dt>
                <dd class="opt">
                    <select name="age_status" class="input-txt">
                        <option value="0" {if condition="$info['age_status'] eq 0"} selected="selected"{/if} >禁用</option>
                        <option value="1" {if condition="$info['age_status'] eq 1"} selected="selected"{/if} >启用</option>
                    </select>
                    <span class="err"></span>
                    <p class="notic">所属角色</p>
                </dd>
            </dl>

            <dl class="row">
                    <dt class="tit">
                        <label><em>*</em>所属角色</label>
                    </dt>
                    <dd class="opt">
                        <select name="age_role" class="input-txt">
                            {foreach $role as $k=>$v}
                                <option value="{$v.role_id}" {if condition="$v['role_id'] eq $info['age_role']"} selected="selected"{/if} >{$v.role_name}</option>
                            {/foreach}
                        </select>
                        <span class="err"></span>
                        <p class="notic">所属角色</p>
                    </dd>
                </dl>
            {/if}
            <div class="bot"><button type="submit"  class="btn ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</button></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    //<!--表单验证-->
    $(document).ready(function(){
        $('#adminHandle').Validform({
            tiptype:3,
            beforeSubmit:function(data){
                return true;
            }
        });
//        $("#adminHandle").validate();
    })


    // 判断输入框是否为空
    function adsubmit(){
        $('#adminHandle').submit();
    }
</script>
</body>
</html>